Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

feat: default fp state filter#1546

Open
jeremy-babylonlabs wants to merge 1 commit into
mainfrom
feat/default-fp-state-filter
Open

feat: default fp state filter#1546
jeremy-babylonlabs wants to merge 1 commit into
mainfrom
feat/default-fp-state-filter

Conversation

@jeremy-babylonlabs

Copy link
Copy Markdown
Contributor

No description provided.

@jeremy-babylonlabs jeremy-babylonlabs marked this pull request as ready for review September 5, 2025 23:46
Copilot AI review requested due to automatic review settings September 5, 2025 23:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a default finality provider state filter that dynamically adjusts based on the selected BSN (Babylon Service Network) type. The change introduces logic to automatically set appropriate default provider statuses for different BSN configurations.

  • Added getDefaultProviderStatus function to determine appropriate default status based on BSN type
  • Updated filter initialization to use dynamic defaults instead of hardcoded "active" status
  • Added useEffect to automatically update provider status when BSN selection changes
  • Simplified filter display text by removing "Showing" prefix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
FinalityProviderBsnState.tsx Implements core logic for dynamic default status filtering based on BSN type
FinalityProviders/FinalityProviderFilter.tsx Updates filter display text formatting
Multistaking/FinalityProviders/FinalityProviderFilter.tsx Updates filter display text formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

providerStatus: newProviderStatus,
}));
}
}, [selectedBsn, filter.providerStatus]);

Copilot AI Sep 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The useEffect has filter.providerStatus in its dependency array, which could cause unnecessary re-renders. Since the effect only reads this value for comparison, consider using a ref to track the current status or restructure to avoid the dependency.

Suggested change
}, [selectedBsn, filter.providerStatus]);
}, [selectedBsn]);

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremy-babylonlabs could you check this comment?

@jrwbabylonlab jrwbabylonlab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Rollup that have empty allow list. Will we show the "non-allow listed" as the default instead?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants